package net.models;

// Generated 16 avr. 2013 13:52:25 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Travailler generated by hbm2java
 */
@Entity
@Table(name = "travailler", catalog = "gsbcr")
public class Travailler extends AbstractModel {

	private Integer id;
	private Region region;
	private Visiteur visiteur;
	private Date jjmmaa;
	private String traRole;

	public Travailler() {
	}

	public Travailler(Region region, Visiteur visiteur, Date jjmmaa) {
		this.region = region;
		this.visiteur = visiteur;
		this.jjmmaa = jjmmaa;
	}

	public Travailler(Region region, Visiteur visiteur, Date jjmmaa,
			String traRole) {
		this.region = region;
		this.visiteur = visiteur;
		this.jjmmaa = jjmmaa;
		this.traRole = traRole;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		Integer oldValue = this.id;
		this.id = id;
		firePropertyChange("id", oldValue, id);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "regCode", nullable = false)
	public Region getRegion() {
		return this.region;
	}

	public void setRegion(Region region) {
		Region oldValue = this.region;
		this.region = region;
		firePropertyChange("region", oldValue, region);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "visMatricule", nullable = false)
	public Visiteur getVisiteur() {
		return this.visiteur;
	}

	public void setVisiteur(Visiteur visiteur) {
		Visiteur oldValue = this.visiteur;
		this.visiteur = visiteur;
		firePropertyChange("visiteur", oldValue, visiteur);
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "jJMMAA", nullable = false, length = 19)
	public Date getJjmmaa() {
		return this.jjmmaa;
	}

	public void setJjmmaa(Date jjmmaa) {
		Date oldValue = this.jjmmaa;
		this.jjmmaa = jjmmaa;
		firePropertyChange("jjmmaa", oldValue, jjmmaa);
	}

	@Column(name = "traRole", length = 11)
	public String getTraRole() {
		return this.traRole;
	}

	public void setTraRole(String traRole) {
		String oldValue = this.traRole;
		this.traRole = traRole;
		firePropertyChange("traRole", oldValue, traRole);
	}

}
